home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Freeware 2002 November
/
SGI Freeware 2002 November - Disc 1.iso
/
dist
/
fw_cups.idb
/
usr
/
freeware
/
etc
/
cups
/
fix-spool-dir.z
/
fix-spool-dir
Wrap
Text File
|
2002-04-08
|
1KB
|
58 lines
#!/bin/sh
#Tag 0x00000610
#
# Ensure that IRIX spooling system (lpsched) spool dirs are present,
# as CUPS will write interface and status files in them.
#
# Author: Andrea Suatoni
#
# $Id: fix-spool-dir,v 1.1.1.1 2002/02/01 03:31:12 and Exp $
#
IRIX_SPOOLDIR="/var/spool/lp"
PRINT_USER="lp"
PRINT_GROUP="sys"
#
# Checks that we are the super-user
#
CheckPermission() {
cid=`/usr/bin/id | /usr/bin/nawk '{print substr($1,index($1,"("))}'`;
if [ "$cid" != "(root)" ]; then
echo "You must be logged in as root to use this program."
exit 1;
fi
}
#
# Check that the specified spooler dir exists, create it otherwise
#
CheckSpoolDir() {
if [ ! -d $1 ]; then
/sbin/mkdir $1
/sbin/chown $PRINT_USER\:$PRINT_GROUP $1
fi
}
#########################################################################
#
# Main program
#
#
# Ensure that we are root
#
CheckPermission
#
# Create the IRIX spooler directories, if not present
#
CheckSpoolDir $IRIX_SPOOLDIR
CheckSpoolDir $IRIX_SPOOLDIR/activeicons
CheckSpoolDir $IRIX_SPOOLDIR/class
CheckSpoolDir $IRIX_SPOOLDIR/gui_interface
CheckSpoolDir $IRIX_SPOOLDIR/gui_interface/ELF
CheckSpoolDir $IRIX_SPOOLDIR/interface
CheckSpoolDir $IRIX_SPOOLDIR/member
CheckSpoolDir $IRIX_SPOOLDIR/pod